package com.elinshaw

object Start extends App {
  var a = new AppTest("name", 25)
  val b: Long = 100L
  val c = '\u0041'
  val d: String = "string"
  var e: Double = 0.55D
  println(a.x)
  //字符串插值器
  println(s"hello$d")
  println(s"hello${d.length}")
  println("hello\\\\")
  //raw不转义特殊字符
  println(raw"hello\\\\")
  //printf格式化
  val height = 1.9d
  val name = "James"
  println(f"$name%s is $height%2.2f meters tall")
  //操作符即方法 --中缀
  val sum1 = 1 + 2
  val sum2 = 1.+(2)
  d indexOf("t", 0)
  //后缀表示法
  println(23 toLong)
  //前缀表示法
  println(-7)
  //一元操作符
  println((2.0).unary_-) //等价于-2.0 Scala将调用(2.0).unary_-


}
